#!/usr/bin/env python
#coding=utf-8

import time

def timeit(fn):
    def decorator():
        start = time.time()
        fn()
        end = time.time()
        print end - start
    return decorator
    
def is_prime(num):
    i = 2
    while i**2<=num:
        if num%i == 0:
            return False
        i += 1
    return True
@timeit
def prime():
    j,k = 3,1
    while k<10001:
        if is_prime(j):
            k += 1
        j += 2
    print j-2

if __name__ == '__main__':
    prime()